<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('常量列表')" />
	<th:block th:include="include :: layout-latest-css" />
</head>
<body class="gray-bg">

<div class="container-div">
	<div class="row">

		<div class="btn-group-sm" id="toolbar" role="group">
			<a class="btn btn-success" onclick="$.operate.openAdd(800,450)" >
				<i class="fa fa-plus"></i> 新增
			</a>
		</div>

		<div class="col-sm-12 select-table table-condensed " style="height:98%;">
			<table id="bootstrap-table"></table>
		</div>
	</div>
</div>

<th:block th:include="include :: footer" />

	<script th:inline="javascript">
		var editFlag ;
		var removeFlag ;
		var prefix = ctx + "m/env/variable";


		$(function() {
		    var options = {
		        url: prefix + "/page",
		        createUrl: prefix + "/add",
		        updateUrl: prefix + "/edit?id={id}",
		        removeUrl: prefix + "/deleteById",
		        exportUrl: prefix + "/export",
		        modalName: "常量",
				sortName: "createDate",
				sortOrder: "desc",
				method:"get",
		        columns: [
		        {
					width:"20%",
		            field: 'variableName',
		            title: '常量名称',
					align: 'center'
		        },
				{
					width:"20%",
					field: 'variableKey',
					title: '常量key',
					align: 'center'
				},
				{
					width:"20%",
					field: 'variableDesc',
					title: '常量描述',
					align: 'center'
				},
				{
					width:"20%",
					field: 'createDate',
					title: '创建时间',
					sortable: false,
					align: "center"
				},
		        {
					width:"20%",
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\',780,450)"><i class="fa fa-edit"></i>编辑</a> ');
						actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
		                return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);

		});

	</script>
</body>
</html>